//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.baidu.a.a.a.a.a;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public final class c {
    public static String a(byte[] var0, boolean var1) {
        try {
            MessageDigest var2;
            (var2 = MessageDigest.getInstance("MD5")).reset();
            var2.update(var0);
            return a(var2.digest(), "", var1);
        } catch (NoSuchAlgorithmException var3) {
            throw new RuntimeException(var3);
        }
    }

    public static String a(byte[] var0, String var1, boolean var2) {
        StringBuilder var3 = new StringBuilder();
        int var4 = (var0 = var0).length;

        for(int var5 = 0; var5 < var4; ++var5) {
            byte var6 = var0[var5];
            String var7 = Integer.toHexString(255 & var6);
            if(var2) {
                var7 = var7.toUpperCase();
            }

            if(var7.length() == 1) {
                var3.append("0");
            }

            var3.append(var7).append(var1);
        }

        return var3.toString();
    }
}
